﻿using System.Collections.Generic;
using System.ServiceModel;
using DemoLib.Shared.Contracts;
using DemoLib.Shared.Models;

namespace DemoLib.Service.Client.Clients
{
    public class UserServiceClient : ClientBase<IUserService>, IUserService 
    {
        public User GetUserById(int id)
        {
            return Channel.GetUserById(id);
        }

        public IEnumerable<Role> GetRoles()
        {
            return Channel.GetRoles();
        }

        public void Register(RegisterUser registerUser)
        {
            Channel.Register(registerUser);
        }

        public User ValidateUser(string userName, string password)
        {
            return Channel.ValidateUser(userName, password);
        }

        public void UpdateUser(User user)
        {
            Channel.UpdateUser(user);
        }

        public bool ChangePassword(int userId, string oldPassword, string newPassword)
        {
            return Channel.ChangePassword(userId, oldPassword, newPassword);
        }
    }
}
